package com.sure.minion.web.base;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sure.minion.services.base.handler.exception.DefaultAutoHandledException;
import com.sure.minion.web.interceptor.Authorization;
import com.sure.minion.web.interceptor.UserRole;

/**
 * @Description 应用未知错误的处理
 * @author syuan
 * @date 2015年9月15日  下午9:38:04
 * Company: TravelSky
 */
@Controller
public class ErrorController implements org.springframework.boot.autoconfigure.web.ErrorController {

	/** 路径*/
    private static final String PATH = "/error";

    @Authorization(UserRole.ANONYMOUS)
    @RequestMapping(value = PATH)
    public String error() {
    	throw new DefaultAutoHandledException("UNKNOWN_EXCEPTION");
    }

    @Override
    public String getErrorPath() {
        return PATH;
    }
}
